<!DOCTYPE html>
<html>
<script src="/js-test-resources/js-test.js"></script>
<body>
<p id="description"></p>
<p id="console"></p>
<iframe src="data:text/html,"></iframe>
<script>
description('Tests that isolated worlds do not allow cross-origin frame access');
window.jsTestIsAsync = true;

if (window.testRunner) {
    window.addEventListener('message', function(event) {
        var message = JSON.parse(event.data);
        switch (message.type) {
        case 'debug':
            debug(message.message);
            break;
        case 'finish':
            finishJSTest();
            break;
        }
    });

    window.onload = function() {
      testRunner.setIsolatedWorldInfo(2, 'chrome-extension://123', null);
      var iframe = document.getElementsByTagName('iframe')[0];
      iframe.focus();
      iframe.src = 'http://127.0.0.1:8080/security/resources/cross-frame-iframe-for-parent-isolated-world.html';
    }
} else {
    testFailed('Test depends on LayoutTestController and must be run by DRT');
}
</script>
</body>
</html>
